package com.lrkj.back.controller;

import java.util.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.lrkj.back.StartUpOnLoadData;
import com.lrkj.back.entity.*;
import com.lrkj.back.service.*;
import com.lrkj.back.Const;
import com.lrkj.back.vo.constant.PathInfo;
import com.lrkj.back.vo.json.JSONArray;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import cn.com.cbons.mamisay.parent.exception.BusinessException;

import com.github.pagehelper.PageInfo;

@Controller
@RequestMapping("/wutiaoma")
public class ZsWutiaomaHuishouController extends BaseController {

    @Autowired
    private TbEmployeeService tbEmployeeService;

    @Autowired
    private ZsHuishouWutiaomaService tbWutiaoma;

    @Autowired
    private TbDepartmentService packageService;

    @Autowired
    private ZsWanglanService zsWanglanService;

    @Autowired
    private TbProductService tbProductService;

    @Autowired
    private TbPackageMubanService tbPackageMubanService;

    @Autowired
    private TbDepartmentService tbDepartmentService;

    @Autowired
    private ZsDabaoService daobaoservice;

    @RequestMapping(value = "/savePack.do", method = RequestMethod.POST)
    @ResponseBody
    public Map<Object, Object> savePack(ZsHuishou zsHuishou, HttpServletRequest request, HttpServletResponse response)
            throws BusinessException {
        TbEmployee huishouren = tbEmployeeService.selectByEmployeeNo(zsHuishou.getHuishouHuishourenTiaoma());
        TbEmployee jiaojieren = tbEmployeeService.selectByEmployeeNo(zsHuishou.getHuishouJiaojierenTiaoma());
        String[] packageId = request.getParameterValues("packId");
        String[] hswlTiaoma = request.getParameterValues("packWl");
        String[] packageTm = request.getParameterValues("packTm");
        String[] packageName = request.getParameterValues("packName");
        String[] qixiepackageId = request.getParameterValues("packageId");
        String[] packageKeshi = request.getParameterValues("packageKeshi");
        String[] productId = request.getParameterValues("productId");
        String[] productName = request.getParameterValues("productName");
        String[] productSize = request.getParameterValues("productSize");
        String[] productBarCode = request.getParameterValues("productBarCode");
        String[] productqueshiNum = request.getParameterValues("productqueshiNum");
        for (int i = 0; i < hswlTiaoma.length; i++) {
            hswlTiaoma[i] = hswlTiaoma[i].toUpperCase();
        }
        zsHuishou.setHuishouWanglan(hswlTiaoma[0]);
        Map<Object, Object> rtnMap = new HashMap<>();
        try {
            Map<Integer, List<TbProduct>> queshiMap = null;
            if (huishouren != null) {
                if (jiaojieren != null) {
                    if (qixiepackageId != null) {
                        queshiMap = toMapUtil(qixiepackageId, productId, productName, productSize, productBarCode,
                                productqueshiNum);
                    }
                    int success = tbWutiaoma.huishouTm(zsHuishou, packageTm, packageId, packageName,packageKeshi, hswlTiaoma,
                            queshiMap);
                    if (success == 1) {
                        rtnMap.put("status", "true");
                        rtnMap.put("msg", "回收成功");
                    } else {
                        rtnMap.put("status", "false");
                        rtnMap.put("msg", "回收失败");
                    }
                } else {
                    rtnMap.put("status", "false");
                    rtnMap.put("msg", "无效的交接人条码");
                }

            } else {
                rtnMap.put("status", "false");
                rtnMap.put("msg", "无效的回收人条码");
            }
        } catch (Exception e) {
            rtnMap.put("status", "false");
            rtnMap.put("msg", "回收失败");
            e.printStackTrace();
        }
        return rtnMap;
    }

    @RequestMapping(value = "/save.do")
    @ResponseBody
    public Map<Object, Object> save(String pdata,ZsHuishou zsHuishou, HttpServletRequest request, HttpServletResponse response)
            throws BusinessException {
        TbEmployee huishouren = tbEmployeeService.selectByEmployeeNo(zsHuishou.getHuishouHuishourenTiaoma());
        TbEmployee jiaojiren = tbEmployeeService.selectByEmployeeNo(zsHuishou.getHuishouJiaojierenTiaoma());
        String[] packageId = request.getParameterValues("packId");
        String[] depId = request.getParameterValues("keshi");
        String[] packageName = request.getParameterValues("packName");
        String[] packageNum = request.getParameterValues("packNum");
        String[] qixiepackageId = request.getParameterValues("packageId");
        String[] productId = request.getParameterValues("productId");
        String[] productName = request.getParameterValues("productName");
        String[] productSize = request.getParameterValues("productSize");
        String[] productBarCode = request.getParameterValues("productBarCode");
        String[] productqueshiNum = request.getParameterValues("productqueshiNum");
        String hswlTiaoma = request.getParameter("huishouWanglanTiaoma");
        String hswlMingcheng = request.getParameter("huishouWanglanMingcheng");
//        for (int i = 0; i < hswlTiaoma.length; i++) {
//            hswlTiaoma[i] = hswlTiaoma[i].toUpperCase();
//        }
        if(pdata!=null){
            JSONObject jsonObject = JSONObject.parseObject(pdata);
            hswlTiaoma = jsonObject.getString("hswlTiaoma");
            String jiaojiren1 = jsonObject.getString("jiaojiren");
            String huishouren1 =  jsonObject.getString("huishouren");
            huishouren1 = huishouren1.toUpperCase();
            jiaojiren1 = jiaojiren1.toUpperCase();
            huishouren = tbEmployeeService.selectByEmployeeNo(huishouren1);
            jiaojiren = tbEmployeeService.selectByEmployeeNo(jiaojiren1);
            zsHuishou.setHuishouJiaojierenTiaoma(jiaojiren1);
            zsHuishou.setHuishouHuishourenTiaoma(huishouren1);
            com.alibaba.fastjson.JSONArray jsonArray = jsonObject.getJSONArray("datas");
            packageId = new String [jsonArray.size()];
            packageNum = new String [jsonArray.size()];
            packageName = new String [jsonArray.size()];
            depId = new String [jsonArray.size()];
            for (int i = 0; i < jsonArray.size(); i++) {
               Object object = jsonArray.get(i);
               JSONObject jsonObject1 = JSONObject.parseObject(object.toString());
                packageId[i] = jsonObject1.getString("packageId");
                packageNum[i] = jsonObject1.getString("number");
                packageName[i] = jsonObject1.getString("packageName");
                depId[i] = jsonObject1.getString("depId");
            }
        }
        hswlTiaoma = hswlTiaoma.toUpperCase();
        zsHuishou.setHuishouJiaojierenTiaoma(zsHuishou.getHuishouJiaojierenTiaoma().toUpperCase());
        zsHuishou.setHuishouHuishourenTiaoma(zsHuishou.getHuishouHuishourenTiaoma().toUpperCase());
        zsHuishou.setHuishouWanglan(hswlTiaoma);
        Map<Object, Object> rtnMap = new HashMap<>();
        try {
            Map<Integer, List<TbProduct>> queshiMap = null;
            if (huishouren != null) {
                if (jiaojiren != null) {
                    if (qixiepackageId != null) {
                        queshiMap = toMapUtil(qixiepackageId, productId, productName, productSize, productBarCode,
                                productqueshiNum);
                    }
                    zsHuishou.setHuishouHuishourenTiaoma(zsHuishou.getHuishouHuishourenTiaoma().toUpperCase());
                    zsHuishou.setHuishouJiaojierenTiaoma(zsHuishou.getHuishouJiaojierenTiaoma().toUpperCase());
                    int success = tbWutiaoma.huishou(zsHuishou,depId, packageId, packageNum, packageName, hswlTiaoma,
                            hswlMingcheng, queshiMap);
                    if (success == 1) {
                        rtnMap.put("status", "true");
                        rtnMap.put("msg", "回收成功");
                    } else {
                        rtnMap.put("status", "false");
                        rtnMap.put("msg", "回收失败");
                    }
                } else {
                    rtnMap.put("msg", "无效的回收人条码");
                    rtnMap.put("status", "false");
                }
            } else {
                rtnMap.put("msg", "无效的交接人条码");
                rtnMap.put("status", "false");
            }
        } catch (Exception e) {
            rtnMap.put("status", "false");
            rtnMap.put("msg", "回收失败");
            e.printStackTrace();
        }
        return rtnMap;
    }


    @RequestMapping("/cangjia")
    public ModelAndView cangjia()
            throws BusinessException {
        Map<String,Object> map = new HashMap<>();
        map.put("departmentIsclean",1);
        List<TbDepartment> departmentList = tbDepartmentService.findDepartment(map);
        List<ZsDabao> daolist = daobaoservice.selectAllDabao();
        List<TbDict> miejunfangshiList = StartUpOnLoadData.dataListMap.get(StartUpOnLoadData.MIEJUN_KEY);
        request.setAttribute("daolist", daolist);
        request.setAttribute("depList", departmentList);
        request.setAttribute("miejunFangshi", miejunfangshiList);
//        request.setAttribute("type",type);
        return new ModelAndView("/huishou/huishou_cangjiapackage");
    }



    @RequestMapping("/appendWanglan.do")
    public ModelAndView appendWanglan(String num, HttpServletRequest request, HttpServletResponse response)
            throws BusinessException {
        Integer wanglanNum = Integer.valueOf(num);
        request.setAttribute("wanglanNum", wanglanNum);

        return new ModelAndView("/huishou/huishou_adwanglan");
    }

    @RequestMapping("/findwanglan.do")
    @ResponseBody
    public Map<Object, Object> findwanglan(String huishouWanglanTiaoma, HttpServletRequest request, HttpServletResponse response)
            throws BusinessException {
        Map<Object, Object> rtnMap = new HashMap<>();
        try {
            if (StringUtils.isBlank(huishouWanglanTiaoma)) {
                rtnMap.put("status", false);
                rtnMap.put("msg", "");
            } else {
                ZsWanglan zsWanglan = new ZsWanglan();
                zsWanglan = zsWanglanService.selectByPrimaryKey(huishouWanglanTiaoma);
                Integer state = zsWanglan.getWlState();


                if (zsWanglan != null ) {
                    if(state == 2){
                        rtnMap.put("status", false);
                        rtnMap.put("msg", "网篮正在清洗 请审核");
                    }else{
                        rtnMap.put("status", true);
                        rtnMap.put("zsWanglan",zsWanglan );
                    }

                } else {
                    rtnMap.put("status", false);
                    rtnMap.put("msg", "没有该网篮");
                }

            }

        } catch (Exception e) {
            e.printStackTrace();
        }
        return rtnMap;

    }

    @RequestMapping("/allDeptList.do")
    public ModelAndView findAllDept(HttpServletRequest request, HttpServletResponse response) throws BusinessException {
        List<TbDepartment> list = tbDepartmentService.findAllDepartment();
        Collections.sort(list,new TbDepartSort());
        Map<String,Object> map = new HashMap<>();
        map.put("packageDepartid",PathInfo.depXiaodu);
        List<TbPackageMuban> packages = tbPackageMubanService.findAllPackageNoPageList(map);
        Collections.sort(packages,new SortByDep(Integer.valueOf(PathInfo.depXiaodu)));
        Object jsonObject = JSONObject.toJSON(packages);
        Object jsonObject1 = JSONObject.toJSON(StartUpOnLoadData.singleDataMap);
        request.setAttribute("packages", jsonObject);
        request.setAttribute("miejun", jsonObject1);
        request.setAttribute("deptList", list);
        request.setAttribute("selected",PathInfo.depXiaodu);
        return new ModelAndView("/huishou/huishou_adpackage");
    }

    @RequestMapping("/allDeptList")
    @ResponseBody
    public Map<String,Object> findAllDeptAndroid(HttpServletRequest request, HttpServletResponse response) throws BusinessException {
        List<TbDepartment> list = new ArrayList<>();
        list = tbDepartmentService.findAllDepartment();
        Map<String,Object> map = new HashMap<>();
        map.put("datas",list);
        return map;
    }

    /**
     * 根据部门号查询包
     * 
     * @param request
     * @param response
     */
    @RequestMapping("/findHuishouPackageByDepart")
    @ResponseBody
    public Map<Object,Object> findHuishouPackageByDepartAndroid(String pdata,HttpServletRequest request, HttpServletResponse response)
            throws BusinessException {
        Map<Object, Object> rtnMap = new HashMap<>();
        try {
            String packageDepartid = request.getParameter("packageDepartid");
            String packageCode = request.getParameter("packageCode");

            if(pdata!=null){
                JSONObject jsonObject = JSONObject.parseObject(pdata);
                packageDepartid = jsonObject.getString("packageDepartid");
                packageCode = jsonObject.getString("packageCode");
            }
            Map<String, Object> map = new HashMap<>();
            if (StringUtils.isNotBlank(packageDepartid)&&!"0".equals(packageDepartid)) {
                Integer depId = Integer.valueOf(packageDepartid);
                if(depId != PathInfo.depShoushu&&depId != PathInfo.depXiaodu){
                    map.put("packageCategory2",1);
                    map.put("packageDepartid",packageDepartid);
                }else{
                    map.put("packageDepartid", packageDepartid);
                }
            }
            if (StringUtils.isNotBlank(packageCode)) {
                map.put("packageName", packageCode);
            }
            List<TbPackageMuban> packages = tbPackageMubanService.findAllPackageNoPageList(map);
            Collections.sort(packages,new SortByDep(Integer.valueOf(packageDepartid)));
            PackageAndroid packageAndroid = new PackageAndroid();
            List<PackageAndroid> list = new ArrayList<>();
            for (int i = 0; i < packages.size(); i++) {
                packageAndroid = new PackageAndroid();
                TbPackageMuban tbPackageMuban = packages.get(i);
                String baozhuangName= "";
                String depName = "";
                String mieJunFangshi = "";
                if(tbPackageMuban!=null){
                    ZsDabao zsDabao= tbPackageMuban.getZsDabao();
                    if(zsDabao!=null){
                        baozhuangName =  zsDabao.getDabaoName();
                    }
                    Integer integer = tbPackageMuban.getPackageMiejunFangshi();
                    Long miejunId = 0L;
                    if(integer!=null){
                        miejunId = Long.valueOf(integer);
                    }
                    TbDict dict  = StartUpOnLoadData.singleDataMap.get(miejunId);
                    if(dict!=null){
                        mieJunFangshi = dict.getDictName();
                    }
                }

                depName = StartUpOnLoadData.depMap.get(packageDepartid);
                packageAndroid.setDepId(packageDepartid);
                packageAndroid.setPackageId(tbPackageMuban.getPackageId());
                packageAndroid.setPackageName(tbPackageMuban.getPackageName());
                packageAndroid.setBaoZhuangName(baozhuangName);
                packageAndroid.setDepName(depName);
                packageAndroid.setMiejunFangshi(mieJunFangshi);
                //包装类型
                //灭菌方式

                if(packageAndroid!=null){
                    list.add(packageAndroid);
                }

            }

            rtnMap.put("datas", list);
            rtnMap.put("status", "true");
            rtnMap.put("msg", "查询成功");
        } catch (Exception e) {
            rtnMap.put("status", "false");
            rtnMap.put("msg", "查询失败");
            e.printStackTrace();
        }
        return rtnMap;
    }


    /**
     * 根据部门号查询包
     *
     * @param request
     * @param response
     */
    @RequestMapping("/findHuishouPackageByDepart.do")
    @ResponseBody
    public Map<Object,Object> findHuishouPackageByDepart(String pdata,HttpServletRequest request, HttpServletResponse response)
            throws BusinessException {
        Map<Object, Object> rtnMap = new HashMap<>();
        try {
            String packageDepartid = request.getParameter("packageDepartid");
            String packageCode = request.getParameter("packageCode");

            Map<String, Object> map = new HashMap<>();
            if (StringUtils.isNotBlank(packageDepartid)&&!"0".equals(packageDepartid)) {
                Integer depId = Integer.valueOf(packageDepartid);
                if(depId != PathInfo.depShoushu&&depId != PathInfo.depXiaodu){
                    map.put("packageCategory2",1);
                    map.put("packageDepartid",packageDepartid);
                }else{
                    map.put("packageDepartid", packageDepartid);
                }
            }
            if (StringUtils.isNotBlank(packageCode)) {
                map.put("packageName", packageCode);
            }
            List<TbPackageMuban> packages = tbPackageMubanService.findAllPackageNoPageList(map);
            Collections.sort(packages,new SortByDep(Integer.valueOf(packageDepartid)));
            rtnMap.put("packages", packages);
            rtnMap.put("miejun", StartUpOnLoadData.singleDataMap);
            rtnMap.put("status", "true");
            rtnMap.put("msg", "查询成功");
        } catch (Exception e) {
            rtnMap.put("status", "false");
            rtnMap.put("msg", "查询失败");
            e.printStackTrace();
        }
        return rtnMap;
    }

    @RequestMapping("/findQixieList.do")
    public ModelAndView findQixieList(String id, String name, HttpServletRequest request, HttpServletResponse response)
            throws BusinessException {
        Integer sid = Integer.valueOf(id);
        Integer pageNo = request.getParameter("pageIndex") == null ? 1 : Integer.valueOf(request
                .getParameter("pageIndex"));
        Map<String, Object> map = new HashMap<>();
        map.put("packageId", sid);
        map.put("pageNo", pageNo);
        //
        map.put("pageSize", Const.PAGE_SIZE);
        PageInfo<TbProduct> page = tbProductService.findQixieByPackagePage(map);
        request.setAttribute("total", page.getPages());
        request.setAttribute("tbproductList", page.getList());
        request.setAttribute("packageId", sid);
        request.setAttribute("packname", name);
        return new ModelAndView("/huishou/huishou_productlist");
    }

    @RequestMapping("/findQixieListPeibao.do")
    public ModelAndView findQixieListPeibao(String id, String name, HttpServletRequest request,
            HttpServletResponse response) throws BusinessException {
        Integer sid = Integer.valueOf(id);
        Integer pageNo = request.getParameter("pageIndex") == null ? 1 : Integer.valueOf(request
                .getParameter("pageIndex"));
        Map<String, Object> map = new HashMap<>();
        map.put("packageId", sid);
        map.put("pageNo", pageNo);
        map.put("pageSize", Const.PAGE_SIZE);
        PageInfo<TbProduct> page = tbProductService.findQixieByPackagePage(map);
        request.setAttribute("total", page.getPages());
        request.setAttribute("tbproductList", page.getList());
        request.setAttribute("packageId", sid);
        request.setAttribute("packname", name);
        return new ModelAndView("/peibao/peibao_productlist");

    }

    @RequestMapping("/peibaoSave")
    @ResponseBody
    public Map<String,Object> peibaoSave(String data,String huishouren,String [] packageId, String [] packageNum,String [] depId, HttpServletRequest request,
                                            HttpServletResponse response) throws BusinessException {
        Map<String, Object> rtnMap = new HashMap<>();
        if(data!=null){
            com.alibaba.fastjson.JSONArray jsonArray = JSON.parseArray(data);
            packageId = new String [jsonArray.size()];
            packageNum = new String [jsonArray.size()];
            depId = new String [jsonArray.size()];
            for (int i = 0; i < jsonArray.size(); i++) {
                JSONObject jsonObject= jsonArray.getJSONObject(i);
                packageId[i] = jsonObject.getString("packId");
                packageNum[i] = jsonObject.getString("packageNum");
                depId[i] = jsonObject.getString("depId");
            }
        }

        try{
            huishouren = huishouren.toUpperCase();
            TbEmployee tbEmployee = tbEmployeeService.selectByEmployeeNo(huishouren);
            if(tbEmployee!=null){
                int i = tbWutiaoma.peibaoSave(packageId,packageNum,depId,huishouren);
                rtnMap.put("status", "true");
                rtnMap.put("msg", "查询成功");
            }else{
                rtnMap.put("status", "false");
                rtnMap.put("msg", "请扫描正确的回收人条码");
            }


        }catch (Exception e){
            rtnMap.put("status", "false");
            rtnMap.put("msg", "查询失败");
            e.printStackTrace();

        }
        return rtnMap;

    }

    /**
     * 将器械缺失的信息传入进来，封装成一个缺失的map
     * 
     * @param qixiepackageId
     * @param productId
     * @param productName
     * @param productSize
     * @param productBarCode
     * @param productqueshiNum
     * @return
     */
    private Map<Integer, List<TbProduct>> toMapUtil(String[] qixiepackageId, String[] productId, String[] productName,
            String[] productSize, String[] productBarCode, String[] productqueshiNum) throws BusinessException {
        Map<Integer, List<TbProduct>> map = new HashMap<>();
        List<TbProduct> list = null;
        for (int i = 0; i < qixiepackageId.length; i++) {
            TbProduct product = new TbProduct();
            if (map.containsKey(Integer.valueOf(qixiepackageId[i]))) {
                list = map.get(Integer.valueOf(qixiepackageId[i]));
                product.setProductId(Integer.valueOf(productId[i]));
                product.setProductName(productName[i]);
                product.setProductSize(productSize[i]);
                product.setProductBarcode(productBarCode[i]);
                product.setNum(Integer.valueOf(productqueshiNum[i]));
                list.add(product);
            } else {
                list = new ArrayList<TbProduct>();
                product.setProductId(Integer.valueOf(productId[i]));
                product.setProductName(productName[i]);
                product.setProductSize(productSize[i]);
                product.setProductBarcode(productBarCode[i]);
                product.setNum(Integer.valueOf(productqueshiNum[i]));
                list.add(product);
            }
            map.put(Integer.valueOf(qixiepackageId[i]), list);
        }
        return map;
    }

}

class  TbDepartSort implements Comparator {

    private String  departmentMark;

    public TbDepartSort(String departmentMark){
        this.departmentMark = departmentMark;
    }

    public TbDepartSort(){

    }

    @Override
    public int compare(Object o1, Object o2) {
        int a =1000;
        int b =1000;
        TbDepartment t1 = (TbDepartment)o1;
        TbDepartment t2 = (TbDepartment)o2;
        String depId1 = t1.getDepartmentMark();
        String depId2 = t2.getDepartmentMark();
        if("".equals(t1.getDepartmentMark())){
            t1.setDepartmentMark(null);
        }
        if("".equals(t2.getDepartmentMark())){
            t2.setDepartmentMark(null);
        }

        if(t1.getDepartmentMark()!=null){
            a = Integer.valueOf(t1.getDepartmentMark());
        }
        if(t2.getDepartmentMark()!=null){
            b = Integer.valueOf(t2.getDepartmentMark());
        }
        return  a-b;
    }
}




class  SortByDep implements Comparator {

    private Integer depId;

    public SortByDep(Integer depId){
        this.depId = depId;
    }

    public SortByDep(){

    }

    @Override
    public int compare(Object o1, Object o2) {

        TbPackageMuban t1 = (TbPackageMuban)o1;
        TbPackageMuban t2 = (TbPackageMuban)o2;
        Integer depId1 = t1.getPackageDepartid();
        Integer depId2 = t2.getPackageDepartid();
        int a = 10000;
        int b = 10000;
        if("".equals(t1.getPackageNo())){
            t1.setPackageNo(null);
        }
        if("".equals(t2.getPackageNo())){
            t2.setPackageNo(null);
        }

        if(t1.getPackageNo()!=null){
            a = Integer.valueOf(t1.getPackageNo());
        }else if(depId1.equals(depId)){
            a = 100;
        }
        if(t2.getPackageNo()!=null){
            b = Integer.valueOf(t2.getPackageNo());
        }else if(depId2.equals(depId)){
            b = 100;
        }

        return  a-b;
    }
}

 class PackageAndroid{
    //包的科室id 不显示 发给我
    String depId;
    //包的id
    String packageId;
    //包的明细
    String packageName;
    //包的数量
    String packageNum;
    //科室名
     String depName;
     //包装类型
     String baoZhuangName;
     //灭菌方式
     String miejunFangshi;

     public String getDepName() {
         return depName;
     }

     public void setDepName(String depName) {
         this.depName = depName;
     }

     public String getBaoZhuangName() {
         return baoZhuangName;
     }

     public void setBaoZhuangName(String baoZhuangName) {
         this.baoZhuangName = baoZhuangName;
     }

     public String getMiejunFangshi() {
         return miejunFangshi;
     }

     public void setMiejunFangshi(String miejunFangshi) {
         this.miejunFangshi = miejunFangshi;
     }

     public String getDepId() {
         return depId;
     }

     public void setDepId(String depId) {
         this.depId = depId;
     }

     public String getPackageId() {
         return packageId;
     }

     public void setPackageId(String packageId) {
         this.packageId = packageId;
     }

     public String getPackageName() {
         return packageName;
     }

     public void setPackageName(String packageName) {
         this.packageName = packageName;
     }

     public String getPackageNum() {
         return packageNum;
     }

     public void setPackageNum(String packageNum) {
         this.packageNum = packageNum;
     }
 }
